package com.itheima.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.itheima.dao.*;
import com.itheima.entity.PageResult;
import com.itheima.entity.QueryPageBean;
import com.itheima.entity.Result;
import com.itheima.pojo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Set;

/**
 * 用户服务
 */
@Service(interfaceClass = WTPsychologyService.class)
@Transactional
public class WTPsychologyServicelmpl implements WTPsychologyService{

    @Autowired
    private WTPsychologyDao wtPsychologyDao;

    @Override
    public PageResult findAllPsychology(QueryPageBean queryPageBean) {

        Integer currentPage = queryPageBean.getCurrentPage();
        Integer pageSize = queryPageBean.getPageSize();
        PageHelper.startPage(currentPage,pageSize);
        //通过子查询查出所有的用户的所有角色的所有菜单项
        Page<WTpsychology> page = wtPsychologyDao.findAllMemberPsy(queryPageBean);
        return new PageResult(page.getTotal(),page.getResult());
    }
}
